using System;
using System.Data;
using System.Collections;

namespace Company.Product.Entity.ConditionForm
{
	/// <summary>
	/// Summary description for KeHoachChiTieu.
	/// </summary>
	public class KeHoachChiTieuConditionForm
	{

      #region Fields

      private Int32 _IDChiTieu;
      private Int32 _LoaiChiTieu;
      private DateTime _ThoiGianThem;
      private DateTime _ThoiGianCapNhat;
      private Int32 _SoTien;
      private string _GhiChu;

      #endregion

      #region Properties

	public bool IsSetIDChiTieu;  
    public bool IsIDChiTieuNullable
      { get { return false;  } }
      public Int32 IDChiTieu
      {
         get { return _IDChiTieu; }
         set { 
		_IDChiTieu = value; 
		IsSetIDChiTieu = true;
		}
      }
	public bool IsSetLoaiChiTieu;
	public bool IsLoaiChiTieuNullable
      { get { return true;  } }
      public Int32 LoaiChiTieu
      {
         get { return _LoaiChiTieu;  }
         set { 
		_LoaiChiTieu = value; 
		IsSetLoaiChiTieu = true;
		}
      }
	public bool IsSetThoiGianThem;
	public bool IsThoiGianThemNullable
      { get { return true;  } }
      public DateTime ThoiGianThem
      {
         get { return _ThoiGianThem;  }
         set { 
		_ThoiGianThem = value; 
		IsSetThoiGianThem = true;
		}
      }
	public bool IsSetThoiGianCapNhat;
	public bool IsThoiGianCapNhatNullable
      { get { return false;  } }
      public DateTime ThoiGianCapNhat
      {
         get { return _ThoiGianCapNhat;  }
         set { 
		_ThoiGianCapNhat = value; 
		IsSetThoiGianCapNhat = true;
		}
      }
	public bool IsSetSoTien;
	public bool IsSoTienNullable
      { get { return false;  } }
      public Int32 SoTien
      {
         get { return _SoTien;  }
         set { 
		_SoTien = value; 
		IsSetSoTien = true;
		}
      }
	public bool IsSetGhiChu;
	public bool IsGhiChuNullable
      { get { return true;  } }
      public string GhiChu
      {
         get { return _GhiChu;  }
         set { 
		_GhiChu = value; 
		IsSetGhiChu = true;
		}
      }

	public string ConditionQuery
	{
		get { return GetCondtionQuery(); }
	}

      #endregion

      #region Constructors
      public KeHoachChiTieuConditionForm()
      {
         Reset();
      }
      #endregion

      public void Reset()
      {
         _IDChiTieu = EmptyValues.v_Int32;
	IsSetIDChiTieu = false;
         _LoaiChiTieu = EmptyValues.v_Int32;
	IsSetLoaiChiTieu = false;
         _ThoiGianThem = EmptyValues.v_DateTime;
	IsSetThoiGianThem = false;
         _ThoiGianCapNhat = EmptyValues.v_DateTime;
	IsSetThoiGianCapNhat = false;
         _SoTien = EmptyValues.v_Int32;
	IsSetSoTien = false;
         _GhiChu = EmptyValues.v_string;
	IsSetGhiChu = false;
      }

        private string GetCondtionQuery()
        {
            //if (obj == null) { return ""; }
            string s = "";
            if (IsSetIDChiTieu)
            {
                s += " AND IDChiTieu = @IDChiTieu ";
            }
            if (IsSetLoaiChiTieu)
            {
                s += " AND LoaiChiTieu = @LoaiChiTieu ";
            }
            if (IsSetThoiGianThem)
            {
                s += " AND ThoiGianThem = @ThoiGianThem ";
            }
            if (IsSetThoiGianCapNhat)
            {
                s += " AND ThoiGianCapNhat = @ThoiGianCapNhat ";
            }
            if (IsSetSoTien)
            {
                s += " AND SoTien = @SoTien ";
            }
            if (IsSetGhiChu)
            {
                s += " AND GhiChu = @GhiChu ";
            }

            if (s.Length > 0)
            {
                return " WHERE " + s.Substring(4);
            }
            return "";
        }
   }
}